home *** CD-ROM | disk | FTP | other *** search
- on bugchoose
- global lev, nlist, game3level, bugnumber, buglist
- repeat with xxx = 5 to 34
- puppetSprite(xxx, 0)
- set the visible of sprite xxx to 0
- end repeat
- updateStage()
- set many to game3level * 2
- if game3level = 1 then
- set bugnumber to [10]
- set most to 5
- set mgroup to 1
- else
- if game3level = 2 then
- set bugnumber to [20]
- set most to 5
- set mgroup to 0
- else
- set bugnumber to [28]
- set most to 10
- set mgroup to 0
- end if
- end if
- repeat with xxx = 1 to many + 2
- set disgrunt to getAt(bugnumber, 1)
- set yib to random(disgrunt - (3 + many - xxx))
- if yib > most then
- set yib to random(most)
- end if
- add(bugnumber, yib)
- setAt(bugnumber, 1, disgrunt - yib)
- end repeat
- repeat with xxx = 1 to many + 1
- set disgrunt to getAt(bugnumber, xxx)
- if disgrunt > most then
- set diff to disgrunt - most
- set disgrunt to most
- setAt(bugnumber, xxx, disgrunt)
- setAt(bugnumber, xxx + 1, getAt(bugnumber, xxx + 1) + diff)
- end if
- end repeat
- put bugnumber
- repeat with xxx = 1 to many - 1
- repeat with slumlord = xxx + 1 to many
- if getAt(bugnumber, xxx) < getAt(bugnumber, slumlord) then
- set trex to getAt(bugnumber, slumlord)
- setAt(bugnumber, slumlord, getAt(bugnumber, xxx))
- setAt(bugnumber, xxx, trex)
- end if
- end repeat
- end repeat
- repeat with xxx = 1 to many
- set slumlord to random(many)
- set trex to getAt(bugnumber, slumlord)
- setAt(bugnumber, slumlord, getAt(bugnumber, xxx))
- setAt(bugnumber, xxx, trex)
- end repeat
- set templist to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
- set buglist to []
- repeat with xxx = 1 to count(bugnumber)
- set slumlord to random(count(templist))
- add(buglist, getAt(templist, slumlord))
- deleteAt(templist, slumlord)
- end repeat
- set buggrid to []
- repeat with xxx = 1 to 8
- add(buggrid, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
- end repeat
- if game3level < 3 then
- set buggrid to [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
- end if
- set bugstart to the number of cast "bug1" - 1
- set channel to 5
- repeat with xxx = 1 to count(bugnumber)
- set tempx to random(8) + 1
- set tempy to random(5) + 1
- repeat with yyy = 1 to getAt(bugnumber, xxx)
- set spriteinfo to []
- add(spriteinfo, getAt(buglist, xxx) + bugstart)
- if mgroup = 1 then
- set tempx to tempx + random(3) - 2
- set tempy to tempy + random(3) - 2
- if (tempx < 1) or (tempx > 10) then
- set tempx to random(10)
- end if
- if (tempy < 1) or (tempy > 7) then
- set tempy to random(7)
- end if
- else
- set tempx to random(10)
- set tempy to random(7)
- end if
- repeat while getAt(getAt(buggrid, tempy), tempx) <> 0
- if mgroup = 1 then
- set tempx to tempx + random(3) - 2
- set tempy to tempy + random(3) - 2
- if (tempx < 1) or (tempx > 10) then
- set tempx to random(10)
- end if
- if (tempy < 1) or (tempy > 7) then
- set tempy to random(7)
- end if
- next repeat
- end if
- set tempx to random(10)
- set tempy to random(7)
- end repeat
- setAt(getAt(buggrid, tempy), tempx, 1)
- add(spriteinfo, (tempx * 64) - 32)
- add(spriteinfo, (tempy * 50) - 25)
- add(spriteinfo, 1)
- sactivate(channel, spriteinfo)
- set channel to channel + 1
- end repeat
- end repeat
- updateStage()
- end
-
- on dohint
- global TRIAL, game3level, tesla
- set TRIAL to TRIAL + 1
- if TRIAL = 1 then
- givehint("bag3.0")
- else
- if TRIAL = 2 then
- givehint("bag3.1")
- hibugall()
- else
- givehint("bag3.2")
- flashanswer()
- givehint("bag3.3")
- end if
- end if
- go("levela" & game3level)
- end
-
- on sactivate schan, slist
- if schan < 48 then
- if listp(slist) then
- puppetSprite(schan, 1)
- set the type of sprite schan to getAt(slist, 4)
- set the castNum of sprite schan to getAt(slist, 1)
- set the locH of sprite schan to getAt(slist, 2)
- set the locV of sprite schan to getAt(slist, 3)
- set the foreColor of sprite schan to 255
- set the ink of sprite schan to 36
- set the stretch of sprite schan to 0
- set the visible of sprite schan to 1
- end if
- end if
- end
-
- on sinfo schan
- set dumdyo to []
- add(dumdyo, the castNum of sprite schan)
- add(dumdyo, the locH of sprite schan)
- add(dumdyo, the locV of sprite schan)
- add(dumdyo, the type of sprite schan)
- end
-